package com.lin.question;

import org.apache.commons.lang3.StringUtils;

/****************************************************************************
 * com.lin.question AskQuestionWeiChat.java Created on 2016年1月6日
 * 
 * @Author: linfenliang
 * @Description:
 * @Version: 1.0
 ***************************************************************************/
public class AskQuestionWeiChat extends AskQuestion {
	public AskQuestionWeiChat() {
		this.setAskDataType(new AskDataTypeText());
	}

	public static void main(String[] args) {
		AskQuestion aq = new AskQuestionWeiChat();
		String[] in  = aq.formatInputStream("linfenliang/r/nmale/r/n28/r/n医生您好，我想问下，如何缓解久坐导致的腰疼");
		aq.processSession(in);
		String out = aq.formatOutputStream("doctorwang/r/n主任医师/r/n经常活动就好".split("/r/n"));
		System.out.println(out);
	}

	@Override
	public <T, P> T formatInputStream(P in) {
		return (T) StringUtils.splitByWholeSeparator((String) in, "/r/n");
	}

	@Override
	public <T, P> T formatOutputStream(P out) {
		String[] arr = (String[]) out; 
		return (T) StringUtils.join(arr, "/r/n");
	}
}
